package com.niiwoo.civet.account.enums;

import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OpenAccountMajorWay {

    PERSON_BIND_BANK_CARD_REGISTER((byte) 1, "个人注册绑卡"),
    GROUP_ACCOUNT_CORRELATE((byte) 2, "集团账户关联"),
    ACTIVATE((byte) 5, "个人激活");

    private final Byte value;
    private final String desc;

    public static OpenAccountMajorWay of(Byte value) {
        if (value != null) {
            for (OpenAccountMajorWay s : values()) {
                if (s.value.equals(value)) {
                    return s;
                }
            }
        }
        return null;
    }

    public static boolean except(Byte value, OpenAccountMajorWay... status) {
        return (status != null && status.length > 0) && Arrays.asList(status).contains(of(value));
    }

}
